#ifndef _BBGEOMETRY_H_
#define _BBGEOMETRY_H_

/*
	BBPoint
*/
class BBPoint
{
public:
	BBPoint(void);
	BBPoint(float x, float y);
	BBPoint(const BBPoint& other);
	~BBPoint(void);
	BBPoint& operator= (const BBPoint& other);
	void setPoint(float x, float y);
	bool equals(const BBPoint& target) const;
public:
	float x;
	float y;
};

/*
	BBSize
*/
class BBSize
{
public:
	BBSize(void);
	~BBSize(void);
	BBSize(float width,float height);
	BBSize(const BBSize& other);
	BBSize& operator=(const BBSize& other);
	void setSize(float width,float heigth);
	bool equals(const BBSize& size) const;
public:
	float width;
	float height;
};


/*
	BBRectange
*/
class BBRectange
{
public:
	BBRectange(void);  
	BBRectange(float x, float y, float width, float height);
	BBRectange(const BBRectange& other);
	BBRectange& operator= (const BBRectange& other); 
	void setRect(float x, float y, float width, float height);
	float getMinX() const;
	float getMidX() const;
	float getMaxX() const; 
	float getMinY() const;
	float getMidY() const; 
	float getMaxY() const;
	bool equals(const BBRectange& rect) const;   
	bool containsPoint(const BBRectange& point) const;
	bool intersectsRect(const BBRectange& rect) const;

	~BBRectange(void);
public:
	BBPoint origin;
	BBSize  size;
};


#define CreateBBPoint(x, y)						BBPoint((float)(x), (float)(y))
#define CreateBBSize(width, height)			BBSize((float)(width), (float)(height))
#define CreateBBRect(x, y, width, height)	BBRectange((float)(x), (float)(y), (float)(width), (float)(height))


const BBPoint PointZero = CreateBBPoint(0,0);
const BBSize SizeZero = CreateBBSize(0,0);
const BBRectange RectZero = CreateBBRect(0,0,0,0);

#endif //_BBGEOMETRY_H_